package com.czxy.controller;

import com.czxy.service.EsDataService;
import com.czxy.vo.ESData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 张青卯
 */
@RestController
@RequestMapping
public class EsDataController {

    private final EsDataService esDataService;

    @Autowired
    public EsDataController(EsDataService esDataService) {
        this.esDataService = esDataService;
    }

    @GetMapping("/esData")
    public ResponseEntity<List<ESData>> findEsData(){
        List<ESData> list = esDataService.findAll();
        return ResponseEntity.ok(list);
    }
}
